﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;

namespace HaiFang
{
    public partial class SystemParameter : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                JavaScriptSerializer ser = new JavaScriptSerializer();
                int UserID = WebHelper.GetCurrentUserID();
                int ProjectID = WebHelper.GetCurrentUserProjectID();
                if (UserID > 0)
                {
                    IList<MenuFullInfo> list = MenuFullInfo.QueryMenuFullInfo(UserID, ProjectID);
                    ltUserMenuInfo.Text = ser.Serialize(list);
                    ltUserInfo.Text = "[" + ser.Serialize(WebHelper.GetCurrentUserInfo()) + "]";

                    IList<GeneralTypeInfo> gtinfo1 = ProxyGeneralType.QueryGeneralType(UserID, "所属专业");
                    IList<GeneralTypeInfo> gtinfo2 = ProxyGeneralType.QueryGeneralType(UserID, "文件类型");

                    ltProfessionalInfo.Text = ser.Serialize(gtinfo1);
                    ltFileType.Text = ser.Serialize(gtinfo2);
                }
                else
                {
                    ltUserMenuInfo.Text = "";
                    ltUserInfo.Text = "";
                }
            }
        }
    }
}